<!DOCTYPE html>
<html lang="en">
<head>
    {% load static %}
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin Page</title>
    <link rel="stylesheet" href="{% static 'css/admin.css' %}">
</head>
<body>
    <div class="container">
        <h1>管理员页面</h1>
        <h2>现有用户</h2>
        <table>
            <thead>
                <tr>
                    <th>用户名</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {% for user in users %}
                <tr>
                    <td>{{ user.username }}</td>
                    <td>
                        <form method="POST" style="display:inline;">
                            {% csrf_token %}
                            <input type="hidden" name="user_id" value="{{ user.id }}">
                            <button type="submit">删除</button>
                        </form>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <div style="text-align: center; margin-top: 20px;">
            <a href="{% url 'logout' %}" class="logout-button">退出</a>
        </div>
    </div>
</body>
</html>
